<div
	style="min-height: 300px; padding-bottom: 20px; width: 98%; float: left"
	class="portlet x12">
<div class="portlet-header">
<h4>Bài viết
<div class="buttonrow" style="float: right; margin-right: 20px;"><a
	href="<?php
	echo base_url ();
	?>admin/posts/add"><input type="button"
	value="Thêm bài viết" class="btn btn-orange"></a></div>

</h4>
</div>
<!-- .portlet-header -->
<div class="portlet-content">
<table cellpadding="0" cellspacing="0" align="center"
	style="width: 100%;">
	<tr>
		<td style="width: 100%;">
		<table cellpadding="0" cellspacing="0" align="center"
			style="width: 100%;">
			<thead>
				<tr>
					<!--			<th>ID</th>-->
					<th style="width: 70%;">Tiêu đề</th>
					<th>Chức năng</th>
					<!--			<th>S&#7855;p X&#7871;p</th>-->
				</tr>
			</thead>
	<?php
	if (count ( $list ) > 0) {
		?>
	<?php
		foreach ( $list as $item ) {
			?>
		<tr>
				<!--			<td><?php
			echo $item->id;
			?></td>-->
				<td style="width: 70%;">
				<div id="div_cat_name_<?php
			echo $item->id;
			?>" style="font-size:14px;"><?php
			echo $item->subject;
			?>
				</div>
				</td>
				<td><?php // echo $cat->order;				?>
				<input type="button" value="Sửa" class="btn btn-green"
					onclick="window.location='<?php echo base_url();?>admin/posts/edit/<?php echo $item->id;?>'">&nbsp;
					<input
					type="button" value="Xóa" class="btn btn-red"
					onclick="del_item('<?php
			echo $item->id;
			?>','cat')">

				</td>
			</tr>
	<?php
		}
		?>
	<?php
	} else {
		?>
		<tr class="fontGL row0">
				<td colspan="3"><span style="font-size: 13px;">Không có bài viết</span></td>

			</tr>
	<?php
	}
	?>

		</table>
		</td>
	</tr>
</table>
</div>

<!-- .portlet-content -->
<form action="<?php
echo base_url ();
?>admin/store/liststores"
	method="post" id="list_stores_form"></form>
</div>
<!--END main-->
<script>


function viewDetail(id){
	window.location="<?php echo base_url();?>admin/posts/detail/"+id;
}
function del_item(id,type){

	var store_del = confirm("Xoa bài viết ?");

	if(store_del==true){
		window.location="<?php echo base_url();?>admin/posts/del/"+id;
	}else{
		return false;
	}
}
</script>